//
//  NewsFlashViewController.swift
//  ifanr
//
//  Created by 😱😱 on 16/9/13.
//  Copyright © 2016年 😱😱. All rights reserved.
//

import UIKit

class NewsFlashViewController: BasePageViewController {

    // MARK:--------------------------- LifeCycle --------------------------
    override func viewDidLoad() {
        super.viewDidLoad()

        pullToRefresh.delegate = self
        setupUI()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    //MARK: ---------------------------        UI       --------------------------
    private func setupUI() {
        let tabHeaderView = TabHeaderView(model: TableHeaderModelArray.first!)
        
        tableView.tableHeaderView = tabHeaderView
        tableView.sectionFooterHeight = tabHeaderView.height
    }
}

// MARK: - 下拉刷新回调
extension NewsFlashViewController: PullToRefreshDelegate {
    func pullToRefreshViewDidRefresh(pulllToRefreshView: PullToRefreshView) {
        
    }
}

// MARK: - 上拉加载更多
extension NewsFlashViewController {
    override func scrollViewDidScroll(scrollView: UIScrollView) {
        super.scrollViewDidScroll(scrollView)
        if differY < happenY {
            if !isRefreshing {
                // 这里处理上拉加载更多
            }
        }
    }
}
